package com.ll.base.enums;

import com.ll.base.exception.CustomRunTimeException;
import lombok.Getter;

@Getter
public enum ResultCodeEnum {
    //枚举错误
    COURSE_NOT_EXIST("30000","训练不存在"),

    COURSE_STATUS_EXCEPTION("30001","训练状态异常"),

    SIGNUP_STATUS_EXCEPTION("30002","报名状态异常"),

    COURSE_APPLY_MAX("30003","课程人数已满"),


    USER_ERROR("30004","用户信息获取失败"),

    CLASS_APPLY_MAX("30005","课程人数已满"),

    INTEGRAL_ERROR("30006", "积分不够"),

    SIGNUP_ERROR("30007", "自己不能给自己签到"),

    APPLY_ERROR("30008", "自己不能报名自己的课程"),

    USER_EXIST_ERROR("30009","用户已经存在"),

    RANKING_AUTH_ERROR("30010","不能自己认证自己的打榜记录"),


    SOURCE_PK_TODAY_EXIST_ERROR("30011","您今天已经发起过pk了,请明天再发起"),

    TARGET_PK_TODAY_EXIST_ERROR("30012","您挑战的对象今天已经被挑战过了"),

    SOURCE_PK_EXIST_ERROR("30013","您还有pk记录还未处理"),

    TARGET_PK_EXIST_ERROR("30014","您挑战的目标有pk记录还未处理"),
    TARGET_LIMU_ERROR("30015","您不是立木合作伙伴不能核销掉积分"),

    PK_STATUS_EXCEPTION("30015","PK状态已结束"),
    PK_RESULT_EXCEPTION("30016","PK结果已处理"),
    PK_REFEREE_EXCEPTION("30017","PK结果不能由选手处理"),

    //  3500   往后是属于系统级别通用的错误
    SYSTEM_ERROR("1","服务器开小差，请稍后再试"),
    POWER_ERROR("3500","没有权限"),
    DATA_EXIST_ERROR("3501","操作数据已经存在"),
    DATA_NOT_EXIST_ERROR("3502","操作数据不存在"),
    DATA_EXCEPTION_ERROR("3503","操作数据异常"),
    PARAM_VALUE_INVALID("3504","参数无效"),
    PARAM_NOT_EXIST("3505","缺少必须参数"),
    PARAM_METHOD_ERROR("3506","请求方式错误"),
    PARAM_CONTENT_TYPE_ERROR("3507","请求格式错误"),
    ;
    private String code;
    private String msg;
    ResultCodeEnum(String code, String msg){
        this.code = code;
        this.msg = msg;
    }

    ResultCodeEnum(CustomRunTimeException ex){
        this.code = ex.getErrorCode();
        this.msg = ex.getErrorMsg();
    }

}
